﻿using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace InvestmentIntelligence.DbModel.Models
{
    public class TradedQuantity:ICloneable
    {
        public int Id { set; get; }
        public int InvestmentId { set; get; }
        public int? TradeId { set; get; }
        public decimal Quantity { set; get; }
        public DateTime Date { set; get; }
        public int SecurityId { set; get; }
        public decimal? Price { set; get; }
        public decimal? FxRate { set; get; }
        public byte Purpose { set; get; }

        public virtual Investment Investment { set; get; }
        [ForeignKey("SecurityId")]
        public virtual Security Security { set; get; }

        public virtual object Clone()
        {
            return new TradedQuantity
                   {
                       Id = Id,
                       InvestmentId = InvestmentId,
                       Investment = Investment,
                       Date = Date,
                       SecurityId = SecurityId,
                       TradeId = TradeId,
                       Quantity = Quantity,
                       Price = Price,
                       FxRate = FxRate
                   };
        }
    }
}
